import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/src/widgets/framework.dart';
import 'package:ls_work/net/post_request.dart';
import 'package:ls_work/net/response/response_data.dart';
import 'package:ls_work/net/response/user_info_data.dart';
import 'package:ls_work/viewmodel/new_yyt_view_model.dart';

class ServiceOrderHomeViewModel extends BaseViewModel{
  // static UserInfoData userInfo;
  ServiceOrderHomeViewModel(BuildContext context) : super(context);

  Future<void> getUserInfo() async {
    try{
      var data = await PostRequest.userInfo();
      var bean = ResponseBean.fromJson(data);
      if("0"==bean.code){
        var info = UserInfoData.fromJson(bean.data);
        NewYytViewModel.userInfo = info;
      }
    }catch(e){

    }

  }

  @override
  void onCreated() {
    super.onCreated();
    getUserInfo();
  }
}